home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MacWorld 2000 January
/
Macworld (2000-01).dmg
/
QuarkXPress 4.10 update
/
Documents
/
Apple Events Scripting
/
Document Construction
< prev
Wrap
Text File
|
1999-07-26
|
6KB
|
186 lines
tell application "QuarkXPress"
activate
set thepath to (choose folder with prompt "Select the Sample " & ¬
"Documents folder inside the Apple Events Scripting folder of " & ¬
"your QuarkXPress folder:") as text
tell default document 1
set oldHeight to page height
set oldWidth to page width
set oldAutoTextBox to automatic text box
set oldGuidesShowing to guides showing
set xDocMeasure to horizontal measure
set yDocMeasure to vertical measure
set page height to "30 cm"
set page width to "34 cm"
set automatic text box to false
set guides showing to true
set guides in front to true
set horizontal measure to centimeters
set vertical measure to centimeters
end tell
make document at beginning
tell document 1
set view scale to fit page in window
end tell
--CREATE GUIDES TO LAYOUT ELEMENTS ON THE PAGE
tell page 1 of document 1
make horizontal guide at beginning with properties {position:¬
"4.218 cm"}
make horizontal guide at end with properties {position:"8.447 cm"}
make horizontal guide at beginning with properties {position:¬
"27.152 cm"}
make vertical guide at end with properties {position:"2 cm"}
make vertical guide at end with properties {position:"4.962 cm"}
make vertical guide at end with properties {position:"18.742 cm"}
make vertical guide at end with properties {position:"32 cm"}
end tell
--CREATE FIRST TEXT BOX.
tell page 1 of document 1
make text box at beginning with properties {bounds:{"2 cm", "5 cm", "8 cm", "19 cm"}}
tell text box 1
set vertical justification to bottom justified
set color to "none"
end tell
end tell
tell story 1 of text box 1 of page 1 of document 1
set contents of it to "Biking Gear"
set font to "Times"
set size of word 1 to 30
set style of word 1 to all caps
set base shift of word 1 to 60
set track of word 1 to 50
set kern of last character of word 1 to -100
set size of word 2 to 120
set color of word 2 to "Blue"
set style of word 2 to italic
set kern of character 1 of word 2 to -5
set kern of character 2 of word 2 to -5
end tell
--CREATE SECOND TEXT BOX.
tell page 1 of document 1
make text box at end with properties {bounds:{"8.5 cm", "5 cm", "29.959 cm", "18.472 cm"}}
tell text box 2
try
set story 1 to alias (thepath & "ASB Text")
on error
set story 1 to (choose file with prompt "Please select the file \"ASB Text.\"" of type {"TEXT"})
end try
set size of story 1 to 11
set leading of story 1 to 43
set justification of story 1 to full
set font of story 1 to "Times"
end tell
tell paragraph 1 of story 1 of text box 2
set drop cap characters to 1
set drop cap lines to 3
set color of character 1 of word 1 to "Blue"
end tell
tell last paragraph of story 1 of text box 2
set color of character 1 of word 1 to "Blue"
set size of character 1 of word 1 to 28
set rule on of rule above to true
set text length of rule above to false
set width of rule above to 0.5
set position of rule above to "1 cm"
set color of rule above to "Cyan"
set shade of rule above to 100
end tell
end tell
--CREATE FIRST PICTURE BOX.
tell page 1 of document 1
make picture box at beginning with properties ¬
{bounds:{"10.386 cm", "20.758 cm", "27.636 cm", ¬
"33.508 cm"}, color:"None"}
tell picture box 1
set rotation to -25
try
set image 1 to alias (thepath & "Shirts.TIFF")
on error
set image 1 to (choose file with prompt "Please select the file \"Shirts.TIFF.\"" of type {"TIFF"})
end try
tell image 1
set scale to {"115", "115"}
end tell
end tell
end tell
--CREATE SECOND PICTURE BOX.
tell page 1 of document 1
make picture box at end with properties {bounds:¬
{"8.471 cm", "2 cm", "9.971 cm", "3.5 cm"}, color:"None"}
tell picture box 2
try
set image 1 to alias (thepath & "Glove.TIFF")
on error
set image 1 to (choose file with prompt "Please select the file \"Glove.TIFF.\"" of type {"TIFF"})
end try
set bounds of image 1 to exact fit
end tell
duplicate picture box 2 to after picture box 2
tell picture box 3
set bounds to {"12.471 cm", "2 cm", "13.971 cm", "3.5 cm"}
end tell
duplicate picture box 2 to after picture box 3
tell picture box 4
set bounds to {"16.471 cm", "2 cm", "17.971 cm", "3.5 cm"}
end tell
duplicate picture box 2 to after picture box 4
tell picture box 5
set bounds to {"20.471 cm", "2 cm", "21.971 cm", "3.5 cm"}
end tell
end tell
--CREATE THIRD PICTURE BOX.
tell page 1 of document 1
make picture box at end with properties {bounds:{"6.875 cm", ¬
"18.425 cm", "12.729 cm", "26.4 cm"}, color:"None"}
tell picture box 6
try
set image 1 to alias (thepath & "Helmet.TIFF")
on error
set image 1 to (choose file with prompt "Please select " & ¬
"the file \"Helmet.TIFF\"" of type {"TIFF"})
end try
tell image 1
set scale to {"70", "70"}
set offset to {"0.557 cm", "1.254 cm"}
end tell
end tell
end tell
--CREATE LINES
tell page 1 of document 1
make line box at end with properties {left point:¬
{"0 cm", "21.406 cm"}, right point:{"8 cm", "21.406 cm"}}
tell line box 1
set color to "Magenta"
set width to 3
set style to dotted
end tell
make line box at end
tell line box 2
set left point to {"8 cm", "2 cm"}
set right point to {"8 cm", "32 cm"}
set width to 0.5
end tell
end tell
set guides showing of document 1 to false
save document 1 in (thepath & "Constructed Document")
tell default document 1
set page height to oldHeight
set page width to oldWidth
set automatic text box to oldAutoTextBox
set guides showing to oldGuidesShowing
set horizontal measure to xDocMeasure
set vertical measure to yDocMeasure
end tell
end tell